/**
 * Created By wifi_uncle on 2020/2/12
 */
import API from '../api'
import Utils from '../utils'
import { SUCCESS_CODE } from '../constant'
export default {
  /**
   * 获取楼盘列表
   */
  getPremiseList (params, _this) {
    let url = Utils.getPrefix(_this) + API.PREMISE.GET_AGENT_PREMISES_LIST
    const errorMsg = "获取楼盘列表失败"
    return _this.$http.post(url, {params}).then(rsp => {
      const data = rsp.body
      if (data && data.result === SUCCESS_CODE) {
        return Promise.resolve(data.resData.list)
      } else {
        Utils.showFailMsg(errorMsg)
        return Promise.reject(data)
      }
    }, e => {
      Utils.showFailMsg(errorMsg)
      return Promise.reject(e)
    })
  },
}
